package Test;


    public class Person implements Cloneable{
        //想要该类支持深拷贝,覆写object类的clone方法

        private String name;
        private String gender;
        int age;

        @Override
        protected Object clone() throws CloneNotSupportedException
        {
            return super.clone();
        }


    public static void main(String[] args) //throws CloneNotSupportedException
    {
        try{
            Person person = new Person();
            Person person1 = (Person) person.clone();
        }catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

    }
}
